package cn.iocoder.yudao.module.exam.dal.mysql.aimarkingtask;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.exam.dal.dataobject.aimarkingtask.AiMarkingTaskDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.exam.controller.admin.aimarkingtask.vo.*;

/**
 * AI批阅任务 Mapper
 *
 * @author francis
 */
@Mapper
public interface AiMarkingTaskMapper extends BaseMapperX<AiMarkingTaskDO> {

    default PageResult<AiMarkingTaskDO> selectPage(AiMarkingTaskPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AiMarkingTaskDO>()
                .eqIfPresent(AiMarkingTaskDO::getTaskCode, reqVO.getTaskCode())
                .eqIfPresent(AiMarkingTaskDO::getPaperId, reqVO.getPaperId())
                .eqIfPresent(AiMarkingTaskDO::getTaskType, reqVO.getTaskType())
                .eqIfPresent(AiMarkingTaskDO::getTaskStatus, reqVO.getTaskStatus())
                .eqIfPresent(AiMarkingTaskDO::getErrorMessage, reqVO.getErrorMessage())
                .betweenIfPresent(AiMarkingTaskDO::getStartedTime, reqVO.getStartedTime())
                .betweenIfPresent(AiMarkingTaskDO::getCompletedTime, reqVO.getCompletedTime())
                .orderByDesc(AiMarkingTaskDO::getId));
    }

}